<template>
  <div id="mine-order-detail-car">
    <fill-car-info
      v-if="infoReady"
      type="part"
      :info="info"
      :editable="false"></fill-car-info>
  </div>
</template>

<script>
  import FillCarInfo from '../comp/comp-fill-car-info.vue';
  export default {
    name: "mine-order-detail-car",
    components: {
      FillCarInfo
    },
    data() {
      return {
        info: {},
        infoReady: false
      }
    },
    created() {
      this.$http.post({
        api: this.$api.USER_ORDER_DETAIL_SPECIFIC,
        params: {
          car_id: this.$route.params.car_id
        },
        success: (res) => {
          let details = res.data.data;
          this.info = {
            carBrand: details.model,
            place: details.provice,
            type: details.traffic,
            carNum: details.vin,
            carEngineNum: details.engine_num,
            date: details.buy_time,
            usage: details.car_nature,
            locale: details.is_local,
            belong: details.nature,
            newly: details.transfer,
            carTransferDate: details.transfer_date,
            mortgage: details.mortgage,
            beneficiary: details.beneficiary,
            benefitProportion: details.scale,
            specially: details.special_agreement,

            taxesTypeCode: details.taxes_type,
            taxesReductionReasonCode: details.taxes_reason,
            taxesReductionReasonCodeLong: details.taxes_code,
            taxesDepartment: details.taxes_organ,
            taxesReductionPlanCode: details.taxes_program,
            taxesNo: details.taxes_no,
            taxesReduction: details.taxes_amount,
            taxesReductionRate: details.taxes_proportion,
            energyCode: details.fuel_type,

            recognizeeSameAsOwner: details.insured,
            recognizee: details.insured_name,
            recognizeeIdNum: details.insured_num,
            recognizeeTel: details.insured_phone,
            applicant: details.policy_holder,
            applicantName: details.policy_name,
            applicantIdNum: details.policy_num,
            applicantTel: details.policy_phone,

            pictures: details.car_url,
            others: details.remark,

            evidence: [details.certificate_url, details.invoice],
            licence: [details.driving_face, details.driving_back, details.invoice2],
          };

          this.infoReady = true;
        }
      });
    }
  }
</script>

<style scoped lang="scss">
  #mine-order-detail-car {

  }
</style>
